package com.lxb.store.controller;

import com.lxb.store.entity.User;
import org.apache.shiro.SecurityUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class ContactController {

    @RequestMapping("/contact")
    public String contactIndex(Model model){
        //获取登录用户信息
        User loginUser = (User) SecurityUtils.getSubject().getPrincipal();
        //密码设置为空
        if(loginUser != null){
            loginUser.setPassword(null);
        }
        System.out.println("loginUser:"+loginUser);
        model.addAttribute("user",loginUser);
        return "contact";
    }
}
